package com.hj.config;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import com.hj.vo.Result;

@RestControllerAdvice
public class MyExceptionHandler {

	@ExceptionHandler(value = StuManException.class)
	public Result ex1(StuManException ex) {
		Result result = new Result();
		result.setCode(202);
		result.setMsg(ex.getMessage());
		return result;
	}
	
	@ExceptionHandler(value = Exception.class)
	public Result ex(Exception ex) {
		ex.printStackTrace();
		Result result = new Result();
		result.setCode(202);
		result.setMsg("系统错误请联系管理员");
		return result;
	}
	

}
